/**
 * SeriesModel
 * @Chunning.Xu
 * 2011 Nov 22, 2011 3:21:04 PM
 **/
package com.lux.product.models
{
	import flash.display.Loader;
	import flash.display.LoaderInfo;
	import flash.events.Event;
	import flash.net.URLRequest;
	import flash.system.LoaderContext;
	
	public class SeriesModel extends GeneralModel
	{
		//START.
		
		public var title:String;
		public var label:String;
		public var squence:Array;
		public var share:String;
		
		public var des:String;
		public var tip:String;
		public var products:Vector.<ProductModel>;
		
		public var purchase:String;
		public var tracking:TrackingModel;
		
		public function SeriesModel()
		{
		}
		
		
		public override function setXML(xml:XML):void
		{
			this.xml = xml;
			
			title = xml["@title"].toString();
			label = xml["@label"].toString();
			des = xml["des"].toString();
			tip = xml["tip"].toString();
			share = xml["share"].toString();
			squence = xml["@sequence"].toString().split(",");
			
			if(xml.hasOwnProperty("purchase") && xml["purchase"].toString().length > 0)
				purchase = xml["purchase"].toString();	
			
			tracking = new TrackingModel;
			tracking.setXML(xml["tracking"][0]);
			
			products = new Vector.<ProductModel>;
			for each(var prdXML:XML in xml["product"])
			{
				var prdModel:ProductModel = new ProductModel;
				prdModel.setXML(prdXML);
				products.push(prdModel);
			}
		}
		
		//END
	}
}